
// 构造函数模式
function Person(name){
    this.name = name;
    this.start = function () {
        console.log('构造函数');
    }
}

var person1 = new Person('name1');
var person2 = new Person('name2');
person1.start = {}
console.log(typeof person1)
console.log('========构造函数模式===========')

// 静态属性
function Player0(color){
    this.color = color;
    if(!Player0.total){
        Player0.total = 0;
    }
    Player0.total++
}

var p01 = new Player0('www')
console.log(Player0.total)
console.log(p01)
var p02 = new Player0('bbbb')
console.log(Player0.total)
console.log(Player0)
console.log(p02)
console.log('========静态属性===========')
